package com.rentalcar.rental_car.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;       //1代表成功，0代表失败
    private String msg;     //响应信息
    private Object data;    //数据

    public static Result success(){         //增删改，成功
        return new Result(1,"success",null);
    }
    public static Result fail(String fail){            //失败
        return new Result(0,fail,null);
    }
    public static Result fail(){return new Result(0,"错误",null);}
    public static Result success(Object data){          //查询成功
        return new Result(1,"success",data);
    }
}
